function loadBody() {
	loadLeftPanel();
}


function loadLeftPanel()
{
	if (window.XMLHttpRequest){
		leftpanel = new XMLHttpRequest();  //for browsers
    } else
	{
		//fallback for IE5 and IE6
		leftpanel = new ActiveXObject("Microsoft.XMLHTTP");
    }
	leftpanel.onreadystatechange=function(){
		if (leftpanel.readyState==4 && leftpanel.status==200){
			document.getElementById("leftpanel").innerHTML=leftpanel.responseText;
		}
    };
	leftpanel.open("GET","leftpanel.php",true);
	leftpanel.send();
}

function getmemberinfo()
{
	if (window.XMLHttpRequest){
		leftpanel = new XMLHttpRequest();  //for browsers
    } else
	{
		//fallback for IE5 and IE6
		leftpanel = new ActiveXObject("Microsoft.XMLHTTP");
    }
	leftpanel.onreadystatechange=function(){
		if (leftpanel.readyState==4 && leftpanel.status==200){
			document.getElementById("center").innerHTML=leftpanel.responseText;
		}
    };
	leftpanel.open("GET","members.php",true);
	leftpanel.send();
}


function getunpaidbattles(){
	if (window.XMLHttpRequest){
		tablefillajax = new XMLHttpRequest();  //for browsers
    } else
	{
		//fallback for IE5 and IE6
		tablefillajax = new ActiveXObject("Microsoft.XMLHTTP");
    }
	tablefillajax.onreadystatechange=function(){
		if (tablefillajax.readyState==4 && tablefillajax.status==200){
			document.getElementById("center").innerHTML=tablefillajax.responseText;
		}
    };
	tablefillajax.open("GET","./unpaidbattles.php?paid=0",true);
	tablefillajax.send();
}
function getpaidbattles(){
	if (window.XMLHttpRequest){
		tablefillajax = new XMLHttpRequest();  //for browsers
    } else
	{
		//fallback for IE5 and IE6
		tablefillajax = new ActiveXObject("Microsoft.XMLHTTP");
    }
	tablefillajax.onreadystatechange=function(){
		if (tablefillajax.readyState==4 && tablefillajax.status==200){
			document.getElementById("center").innerHTML=tablefillajax.responseText;
		}
    };
	tablefillajax.open("GET","./unpaidbattles.php?paid=1",true);
	tablefillajax.send();
}



function getselectedpendingbattle(id)
{
	if (window.XMLHttpRequest){
		selectedpendingbattleajax = new XMLHttpRequest();  //for browsers
    } else
	{
		//fallback for IE5 and IE6
		selectedpendingbattleajax = new ActiveXObject("Microsoft.XMLHTTP");
    }
	selectedpendingbattleajax.onreadystatechange=function(){
		if (selectedpendingbattleajax.readyState==4 && selectedpendingbattleajax.status==200){
			document.getElementById("currentbattlecontainer").innerHTML=selectedpendingbattleajax.responseText;
			getselectedpendingbattleplayers(id);
		}
    };
	selectedpendingbattleajax.open("GET","./selectedpendingbattle.php?cid="+id,true);
	selectedpendingbattleajax.send();
}

function getselectedpendingbattleplayers(id){
	if (window.XMLHttpRequest){
		lineupfillajax = new XMLHttpRequest();  //for browsers
		reservefillajax = new XMLHttpRequest();
    } else
	{
		//fallback for IE5 and IE6
		lineupfillajax = new ActiveXObject("Microsoft.XMLHTTP");
    }
	lineupfillajax.onreadystatechange=function(){
		if (lineupfillajax.readyState==4 && lineupfillajax.status==200){
			document.getElementById("lineuptable").innerHTML=lineupfillajax.responseText;
		}
    };
	reservefillajax.onreadystatechange=function(){
		if (reservefillajax.readyState==4 && reservefillajax.status==200){
			document.getElementById("reservetable").innerHTML=reservefillajax.responseText;
		}
    };
	
	
	lineupfillajax.open("GET","getplayerstable.php?cid="+id+"&reserve=0",true);
	lineupfillajax.send();
	
	reservefillajax.open("GET","getplayerstable.php?cid="+id+"&reserve=1",true);
	reservefillajax.send();
}



































